<!DOCTYPE html>
<html style="height: 100%">
   <head>
       <meta charset="utf-8">
   </head>
   <body style="height: 100%; margin: 0">
       <div id="container" style="height: 100%"></div>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-gl/echarts-gl.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-stat/ecStat.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/dataTool.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/china.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/map/js/world.js"></script>
       <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=xfhhaTThl11qYVrqLZii6w8qE5ggnhrY&__ec_v__=20190126"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/bmap.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/simplex.js"></script>
       <script type="text/javascript">

        var flag = null;
        var count = 0;
        var max = 10;
        
        function show(max) {
            if (count >= max) {
                clearInterval(flag);
                return;
            }      

        count = count + 1;
        alert( count + 1);
        }

        window.onload = function () {         
            flag=setInterval("showPage()", 3000, max);       
        } 



function showPage()
{
    if (count %2==1) {
        
        count = count + 1;
        showPage2();
        // clearInterval(flag);
        return;
    }      

    count = count + 1;
    // alert( count + 1);

    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};
    option = null;
    app.title = '堆叠条形图';

    option = {
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        legend: {
            data: ['识别风险', '未完成','进行中','已完成']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis:  {
            type: 'value'
        },
        yAxis: {
            type: 'category',
            data: ['成都轨道交通集团有限公司建设分公司','成都地铁运营有限公司','成都现代有轨电车有限公司','成都地铁实业有限公司','成都安捷通物业管理有限公司','成都维创轨道交通特种设备有限责任公司','成都地铁传媒有限公司']
        },
        series: [
            {
                name: '识别风险',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [0, 25, 13, 0, 0, 16, 9]
            },       
            {
                name: '未完成',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [69, 44, 50, 35, 23, 23, 37]
            },
            {
                name: '进行中',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [3, 5, 6, 9, 1, 1, 3]
            },
            {
                name: '已完成',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [25, 19, 21, 22, 13, 9, 16]
            }
        ]
    };;
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
}
       
       

function showPage2()
{
    // document.getElementById("container").innerHTML="";

    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};
    option = null;
    app.title = '堆叠条形图';

    option = {
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        legend: {
            data: ['识别风险', '未完成','进行中','已完成']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis:  {
            type: 'value'
        },
        yAxis: {
            type: 'category',
            data: ['成都轨道交通集团有限公司建设分公司','成都地铁运营有限公司','成都现代有轨电车有限公司','成都地铁实业有限公司','成都安捷通物业管理有限公司','成都维创轨道交通特种设备有限责任公司','成都地铁传媒有限公司']
        },
        series: [
            {
                name: '识别风险',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [0, 25, 13, 0, 0, 16, 9]
            },       
            {
                name: '未完成',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [69, 44, 50, 35, 23, 23, 37]
            },
            {
                name: '进行中',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [3, 5, 6, 9, 1, 1, 3]
            },
            {
                name: '已完成',
                type: 'bar',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'insideRight'
                    }
                },
                data: [30, 24, 26, 27, 18, 24, 21]
            }
        ]
    };;
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
}

       
       </script>
   </body>
</html>